package org.jetlinks.pro.assets.impl.web;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.jetlinks.pro.assets.AssetPermission;

@Getter
@Setter
@AllArgsConstructor(staticName = "of")
@NoArgsConstructor
public class AssetPermissionView {

    @Schema(description = "权限ID")
    private String id;

    @Schema(description = "权限名称")
    private String name;

    public static AssetPermissionView of(AssetPermission permission){
        return of(permission.getValue(),permission.getText());
    }
}
